<!DOCTYPE html>
<html lang="zh_CN">

<head>
    <title>股票历史信息</title>
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
    <link rel="stylesheet" href="../static/bootstrap-4.3.1-dist/css/bootstrap.css">
    <link rel="stylesheet" href="../static/css/history.css">
    <link rel="stylesheet" href="../static/css/head.css">
    <script src="../static/js/head.js"></script>
</head>

<body>
    <header class="my-header">
        <div class="header-container">
            <div class="logo">
                <h1>基于Python爬虫的股票分析预测系统</h1>
                <p>cyz</p>
            </div>
            <nav class="nav-links">
                <ul>
                    <li><a href="{{ url_for('index') }}">主页</a></li>
                    <li><a href="{{ url_for('history') }}">历史数据</a></li>
                    <li><a href="{{ url_for('main') }}">可视化大屏</a></li>
                </ul>
            </nav>

        </div>
        <div class="user-info">
            <ul>
                {% if session['username'] %}
                <li><a href="#">{{ session['username'] }}</a></li>
                <li><a href="{{ url_for('logout') }}">注销</a></li>
                {% else %}
                <li><a href="{{ url_for('login') }}">登录</a></li>
                <li><a href="{{ url_for('register') }}">注册</a></li>
                {% endif %}
                <li>
                    <div id="current-time"></div>
                </li>
            </ul>
        </div>
    </header>
    <a href="{{ url_for('history') }}">
        <h1>股票历史信息</h1>
    </a>
    <a href="{{ url_for('index') }}">
        <h1>返回主页</h1>
    </a>
    <form action="{{ url_for('history') }}" method="POST">
        <label for="stock_name">股票名称：</label>
        <input type="text" id="stock_name" name="stock_name">
        <button class="btn btn-outline-success my-2 my-sm-0" type="submit">查询</button>
    </form>
    {% if error %}
    <p style="text-align: center;color: red;font-size: 18px;">{{ error }}</p>
    {% endif %}
    <!-- 1 -->
    {% if plot %}
    <div id="plot">{{ plot|safe }}</div>
    {% endif %}
    <!-- 2 -->
    {% if bb %}
    <div id="bb">{{ bb | safe }}</div>
    {% endif %}
    <!-- 3 -->
    {% if macd_fig %}
    <div id="macd_fig">{{ macd_fig | safe }}</div>
    {% endif %}
    <!-- 4 -->
    {% if rsi_fig %}
    <div id="rsi_fig">{{ rsi_fig | safe }}</div>
    {% endif %}
    <!-- 5 -->
    {% if vb %}
    <div id="vb">{{ vb | safe }}</div>
    {% endif %}
    <!-- 6 -->
    {% if sa %}
    <div id="sa">{{ sa | safe }}</div>
    {% endif %}
</body>
<script>
    document.body.style.overflow = 'hidden';
    document.addEventListener('mousewheel', function (e) {
        e = e || window.event;
        if ((e.wheelDelta && event.ctrlKey) || e.detail) {
            event.preventDefault();
        }
    }, { capture: false, passive: false });
    document.addEventListener('keydown', function (event) {
        if ((event.ctrlKey === true || event.metaKey === true)
            && (event.keyCode === 61 || event.keyCode === 107
                || event.keyCode === 173 || event.keyCode === 109
                || event.keyCode === 187 || event.keyCode === 189)) {
            event.preventDefault();
        }
    }, false);
</script>

</html>